<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>STAR社区</title>
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/bootstrap/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/css/index.css">
</head>
<body>
<nav th:replace="_fragment :: nav"></nav>
<div class="container-fluid main" th:object="${result}">
    <div class="row">
        <div class="col-lg-9 col-md-12  col-sm-12  col-xs-12">
            <h2>发现</h2>
            <hr>
            <div  class="media" th:each="item : *{list}">
                <div class="media-left">
                    <a th:href="@{/question/{id}(id=${item.id})}">
                        <img class="img_size media-object" src="http://qseoqy0p2.hn-bkt.clouddn.com/zhugeliang.jpg"
                             alt="...">
                    </a>
                </div>
                <div class="media-body">
                    <h4 style="font-weight: 600;margin-top: 5px;line-height: 40px" class="media-heading" ><a th:href="@{/question/{id}(id=${item.id})}" th:text="${item.title}"></a></h4>
                    <div>
                        <div class="text_desc"><span th:text="${item.commentCount}"></span>个回复 • <span
                                th:text="${item.viewCount}"></span>次浏览 • <span
                                th:text="${#dates.format(item.getGmtCreate(), 'yyyy-MM-dd HH:mm:ss')}"></span>
                        </div>
                    </div>
                </div>

            </div>
            <div th:if="*{list.size() != 0}" class="fr">
                <ul class="pagination  pagination-lg">
                    <li th:unless="*{isFirstPage}">
                        <a th:href="${key == null} ? @{/(currentPage=*{pageNum - 1},pageSize=5)} : @{/(currentPage=*{pageNum - 1},pageSize=5, key=${key})}" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li th:each="index: ${#numbers.sequence(firstIndex, lastIndex)}"
                        th:classappend="${index == result.pageNum} ? 'active'"><a
                            th:href="${key == null} ? @{/(currentPage=${index},pageSize=5)} : @{/(currentPage=${index},pageSize=5, key=${key})}" th:text="${index}"></a></li>
                    <li th:unless="*{isLastPage}">
                        <a th:href="${key == null} ? @{/(currentPage=*{pageNum + 1},pageSize=5)} : @{/(currentPage=*{pageNum +1},pageSize=5, key=${key})}" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <h2>热门话题</h2>
        </div>
    </div>
</div>

<script src="/jquery/jquery.js"></script>
<script src="/bootstrap/js/bootstrap.min.js"></script>
<script type="application/javascript">
   window.onload = function (ev) {
       var isLogin = window.localStorage.getItem("closed");
       if (isLogin == "true") {
           window.localStorage.removeItem("closed");
           window.close();
       }
   }
</script>
</body>
</html>